package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.List;

@Getter
@Setter
public class StrategyComment extends BaseDomain{
    public static final Integer STATE_NORMAL=0;//普通
    public static final Integer STATE_COMMEND=1;//推荐
    public static final Integer STATE_DISABLE=-1;//禁用

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    private String content;

    private String imgUrls;

    private Integer starNum;

    private Integer state=STATE_NORMAL;

    private Date commendTime;

    private Strategy strategy;

    private User user;

    private String[] tags;

    //把图片路径是很多图片连起来的字符串,我们把他切成数组,每个对应一张图片
    public String[] getImgArr(){
        if(this.imgUrls!=null){
            return imgUrls.split(";");
        }
        return null;
    }


}